import App from './App'
import { createSSRApp } from 'vue'
export function createApp(){
	const app = createSSRApp(App)
	//随机数
		app.config.globalProperties.$getRandomNunber = function(start,end){
			return Math.floor(Math.random() * (end - start) + start)
		}
	//图形滑块验证码
		//组件被挂载到实例上去之后，生成几个父页面变量
			app.config.globalProperties.$slideCode_init = function(index){
				this.session_id[index]				= app.config.globalProperties.$getRandomNunber(0,999999999);//唯一id
				this.slideCode[index].yanzheng		= false;//图形验证码是否验证通过
				this.slideCode[index].x				= 0//图形验证码的水平偏移值
			}
		//验证通过了
			app.config.globalProperties.$slideCode_success = function(index, data){
				this.slideCode[index].yanzheng		= true//验证通过
				this.slideCode[index].x				= data.x//偏移值
				this.yzm(index)//获取验证码
			}
	return{app}
}